Skip to content

feat: capture email with project recipient suppression rules - #522

Open
raymatos wants to merge 5 commits into
useplunk:nextfrom
raymatos:feat/recipient-suppression
Open

raymatos wants to merge 5 commits into
useplunk:nextfrom
raymatos:feat/recipient-suppression

Conversation

@raymatos

@raymatos raymatos commented Oct 9, 2026 •

Copy link
Copy Markdown

Description

Add project-scoped recipient suppression rules so test messages retain their rendered content without being delivered externally. Rules support exact addresses, exact domains, literal local-part prefixes/suffixes, and bounded whole-address wildcards (* and ?). Settings provides create/edit/enable/disable controls and a saved-rule address preview.

Matching recipients are captured individually as SUPPRESSED; other recipients in the same request retain normal delivery. Decisions are snapshotted, rechecked by the worker, and remain suppressed across retries or later rule changes. Coverage includes transactional API, SMTP envelope recipients, workflow overrides, campaign delivery, and campaign test sends. Alternate recipient headers cannot introduce extra provider recipients.

Captured messages appear once in Activity with a Suppressed filter, rendered preview, and matched-rule details. Project-authorized capture endpoints and two read-only MCP tools expose stored content and existing stored attachments. Captures are excluded from delivery/reputation metrics and billing usage; normal project protections remain in force.

This is related to #258, but deliberately does not implement its automatic SES bounce/complaint list population, CSV import, or reason taxonomy. It adds manually managed capture rules rather than replacing existing bounce/complaint handling.

Migration and compatibility

Adds a rule table, nullable capture fields, an index, and the SUPPRESSED email status. Apply the migration and regenerate the Prisma client for API/worker deployments. Older clients that do not recognize the new enum cannot safely read captured rows; rollback requires a compatible client. Rendered bodies follow existing body retention. Arbitrary regular expressions are not supported.

Type of Change

  • feat: New feature (MINOR version bump)

Testing

Validation on updated head 7e97b09, integrating upstream 09ef948 (0.18.0):

  • Full isolated suite: 1,703 tests passed across 81 files with dummy provider credentials.
  • Workspace lint: all 6 tasks passed. API/dashboard typechecks and MCP/dashboard production builds passed.
  • Preserves upstream scheduled delivery, throttling, lazy previews, inbound activity corrections, MCP project selection and security fixes.
  • Scheduled suppression regression covers future/due processing, a disabled acceptance-time rule, concurrent workers, terminal retries, zero provider calls and release of the unused throttle claim.
  • Existing mixed-recipient, project authorization, retention, Activity pagination and analytics tests pass. Captured bodies remain project-scoped and absent from Activity feed metadata.
  • The suppression feature migration is unchanged. Upstream adds unsubscribe timestamps and scheduled-delivery schema; older clients cannot safely read the new email statuses.
  • Full amd64 deployment image built successfully with Node 24.22.1. Synthetic live captures remained suppressed across repeated processing with zero provider calls; stored rendered content was readable through Activity and the actual read-only MCP protocol.
  • Browser verification passed for saved-rule address preview, invalid-pattern rejection, suppressed filtering, matched-rule details, repeated desktop/mobile rendered previews, and project switching.
  • Upstream CI is action_required, awaiting maintainer approval before jobs start. Local/live validation is separate from upstream CI approval.

Checklist

  • PR title follows conventional commits format
  • API/dashboard and deployment image build successfully
  • Tests pass locally
  • Documentation updated

Related Issues

Related to #258

@raymatos
raymatos marked this pull request as ready for review October 9, 2026 01:14
Raymond Matos added 2 commits October 12, 2026 16:08
Merge next while preserving project-scoped captures, restricted previews and analytics exclusions. Add coverage for the redesigned analytics queries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant